﻿using System;
using System.ServiceModel;
using MouseExtender.WebSite.Logic.DataEntities;

namespace MouseExtender.WebSite.Logic.Services
{
    [ServiceContract]
    public class LoggingService
    {
        [OperationContract]
        public void SubmitErrorReport(ErrorReport errorReport)
        {
            errorReport.ReportTime = DateTime.Now;
            errorReport.IsAnalysed = false;

            using (MEDBDataContext medb = new MEDBDataContext())
            {
                medb.ErrorReports.InsertOnSubmit(errorReport);
                medb.SubmitChanges();
            }
        }
    }
}
